// JavaScript Document
var Language = Class.create({
  initialize: function(name) {
    this.name = name;
	this.clear();
  },
  add: function(key,value) {
	this.keys.push(key);
	this.content.push(value);
  },
  take: function(value) {
	  var id = this.keys.indexOf(value);
	  if(id < 0) return "";
	  return this.content[id];
  },
  clear: function() {
	this.keys = new Array();
	this.content = new Array();
  },
  fromXML: function(language) {
	this.name = language.getAttribute('name');
    var list = language.getElementsByTagName('sentence');
	list.each(function(item){
					this.add(item.getAttribute('key'),item.firstChild.nodeValue);
			  });
  }
});

var LANGUAGE = new Language();
